Page({
  data: {},
  onLoad() {

  },

  onInitChart(F2,config) {
    const chart = new F2.Chart(config);
    console.log(config);
    const data = [
      { const: 'const', type: '圣旨', money: 51.39 },
      { const: 'const', type: '牌匾', money: 356.68 },
      { const: 'const', type: '兵器', money: 20.00 },
      { const: 'const', type: '钱币', money: 116.53 }
    ];
    chart.source(data);
    chart.coord('polar', {
      transposed: true,
      radius: 0.9,
      innerRadius: 0.5
    });
    chart.axis(false);
    chart.legend(false);
    chart.tooltip(false);
    chart.interval().position('const*money').adjust('stack').color('type', ['#1890FF', '#13C2C2', '#2FC25B', '#FACC14']);
    chart.pieLabel({
    sidePadding: 30,
    activeShape: true,
    label1: function label1(data) {
      return {
        text: data.money,
        fill: '#343434',
        fontWeight: 'bold'
      };
    },
    label2: function label2(data) {
      return {
        text: data.type,
        fill: '#999'
      };
    }
  });
    chart.render();
    // 注意：需要把chart return 出来
    return chart;
  }
});
